package com.yxhl.km.module.utils;

/**
 * 测试阶段显示log信息，正式打包需要关掉log
 * Constants.DEBUG 来控制
 * Created by yxr on 2016/3/28.
 */
public class LogUtil {
    private static final String TAG = "App_Log";

    public static void i(Object tag, Object... msg) {
        if (Constants.DEBUG) {
            StringBuilder sb = new StringBuilder();
            for (Object object : msg) {
                sb.append(object);
            }
            android.util.Log.i(TAG, "App_ " + tag + " :: " + sb);
        }
    }

    public static void d(Object tag, Object... msg) {
        if (Constants.DEBUG) {
            StringBuilder sb = new StringBuilder();
            for (Object object : msg) {
                sb.append(object);
            }
            android.util.Log.d(TAG, "App_" + tag + " :: " + sb);
        }
    }

    public static void w(Object tag, Object... msg) {
        if (Constants.DEBUG) {
            StringBuilder sb = new StringBuilder();
            for (Object object : msg) {
                sb.append(object);
            }
            android.util.Log.w(TAG, tag + " :: " + sb);
        }
    }

    public static void e(Object tag, Object... msg) {
        if (Constants.DEBUG) {
            StringBuilder sb = new StringBuilder();
            for (Object object : msg) {
                sb.append(object);
            }
            android.util.Log.e(TAG, tag + " :: " + sb);
        }
    }

    public static void v(Object tag, Object... msg) {
        if (Constants.DEBUG) {
            StringBuilder sb = new StringBuilder();
            for (Object object : msg) {
                sb.append(object);
            }
            android.util.Log.v(TAG, tag + " :: " + sb);
        }
    }

    public static void e(Object tag, Object msg, Throwable tr) {
        if (Constants.DEBUG) {
            android.util.Log.e(TAG, tag + " :: " + msg, tr);
        }
    }
}
